package cn.bj.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.bj.beans.Yxsy;
import cn.bj.dao.YxsyMapper;

@Service
public class YxsyService {
	@Autowired
	YxsyMapper yxsyMapper;

	// 查询所有
	public List<Yxsy> getAllYxhz() {
		return yxsyMapper.selectByExample(null);
	}

	// 新增
	public int insrtYxsy(Yxsy yxsy) {
		return yxsyMapper.insert(yxsy);
	}

	// 删除
	public int deleteYxsy(Integer id) {
		return yxsyMapper.deleteByPrimaryKey(id);
	}

	// 查询单个
	public Yxsy selectById(Integer id) {
		return yxsyMapper.selectByPrimaryKey(id);
	}

	// 修改
	public int updateYxsy(Yxsy yxsy) {
		return yxsyMapper.updateByPrimaryKey(yxsy);
	}
}
